<extend name="Common/common" />
<block name="main">
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <include file="Common/nav-header"/> <!--顶部-->
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加服务</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t " method="post" action="{:U('add')}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">公司坐标：</label>
                            <div class="col-sm-3">
                                <input  type="text" id="location" class="form-control" name="location" value="{$datalists[0].location}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">公司电话：</label>
                            <div class="col-sm-3">
                                <input  type="tel" id="phone" class="form-control" name="phone" value="{$datalists[0].phone}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">公司传真：</label>
                            <div class="col-sm-3">
                                <input  type="text" id="fax" class="form-control" name="fax" value="{$datalists[0].fax}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">公司邮箱：</label>
                            <div class="col-sm-3">
                                <input  type="email" id="email" class="form-control" name="email" value="{$datalists[0].email}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--尾部-->
        <include file="Common/admin:footer"/>
    </div>

    <script>
        $('form').submit(function(){
            var phone = $('#phone').val();
            var fax = $("#fax").val();
            var email = $("#email").val();
            if( phone== ''){
                layer.msg('电话必须位数字',{time:1000});
                return false;
            }
            if(!fax || isNaN(phone)){
                layer.msg('传真必须为数字',{time:1000});
                return false;
            }            
            if(!email){
                layer.msg('请填写邮箱地址',{time:1000});
                return false;
            }
        });
    </script>
</block>

